Skip to content

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Sep 27, 2025

Fixes: #31636

Description

Forces assignment of a function call if a loop is detected inside the function.

This is equivalent to using .toVar() if calling a function without a layout without an inner loop, avoiding unwanted sub-loops.

@sunag sunag added this to the r181 milestone Sep 27, 2025
Copy link

github-actions bot commented Sep 27, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.24
79.14
338.24
79.14
+0 B
+0 B
WebGPU 588.24
162.35
588.65
162.51
+404 B
+159 B
WebGPU Nodes 586.85
162.11
587.25
162.27
+404 B
+157 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 469.7
113.74
469.7
113.74
+0 B
+0 B
WebGPU 657.67
177.84
658.07
177.98
+404 B
+147 B
WebGPU Nodes 611.67
167.02
612.07
167.18
+404 B
+154 B

@sunag sunag marked this pull request as ready for review September 28, 2025 21:24
@sunag sunag merged commit 27bed72 into mrdoob:dev Sep 28, 2025
8 of 9 checks passed
@sunag sunag deleted the dev-loop branch September 28, 2025 21:24
sunag added a commit to sunag/three.js that referenced this pull request Sep 29, 2025
sunag added a commit that referenced this pull request Sep 29, 2025
sunag added a commit to sunag/three.js that referenced this pull request Sep 29, 2025
sunag added a commit that referenced this pull request Sep 29, 2025
…31974)

* move fnCall out of context

* Revert "move fnCall out of context"

This reverts commit 0bb4985.

* Reapply "TSL: Forces assignment of a function call if a loop is detected (#31961)" (#31975)

This reverts commit 699e1fa.

* Reapply "move fnCall out of context"

This reverts commit ee71028.

* Update StackNode.js

* updates

* Revert "updates"

This reverts commit 063a2d2.

* Reapply "updates"

This reverts commit 3b56e1c.

* Update VarNode.js

* Update VarNode.js

* Update VarNode.js

* Update VarNode.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TSL: Store nodes in temporary variables if they are used in a loop
1 participant